package com.star.gateway.service;

import com.star.common.core.exception.CaptchaException;
import com.star.common.core.web.domain.AjaxResult;

import java.io.IOException;

/**
 * 验证码处理
 *
 * @author zhouhengzhe
 */
public interface ValidateCodeService {
    /**
     * 生成验证码
     *
     * @return 统一返回值
     * @throws IOException      异常
     * @throws CaptchaException 异常
     */
    AjaxResult createCaptcha() throws IOException, CaptchaException;

    /**
     * 校验验证码
     *
     * @param key   redis的key
     * @param value redis的value
     * @throws CaptchaException 异常
     */
    void checkCaptcha(String key, String value) throws CaptchaException;
}
